package cn.edu.seu.ssny.dao;

import cn.edu.seu.ssny.dao.support.IBaseDao;
import cn.edu.seu.ssny.entity.Alarm;
import cn.edu.seu.ssny.entity.Device;
import cn.edu.seu.ssny.entity.Project;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface IAlarmDao extends IBaseDao<Alarm, Integer> {
    Alarm findByName(String name);

    List<Alarm> findByProject(Project project);

    Optional<Alarm> findFirstByDeviceOrderByCreateTimeDesc(Device device);

    Integer countAlarmsByProjectAndStatus(Project project, Boolean status);
}
